package com.css.dzj.dzjportal.modules.message.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "PORTAL_MSG", schema = "DZJPORTAL", catalog = "")
public class PortalMsgEntity {
    private String id;
    private String title;
    private String url;
    private String linkId;
    private String status;
    private Date createTime;
    private String createPerson;
    private Date updateTime;
    private String updatePerson;
    private String delFlag;
    private String station;
    private String complainUser;
    private String complainTopic;
    private String complainContent;
    private Date complainTime;
    private String complainStatus;
    private Date dealTime;

    @Id
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "com.css.dzj.dzjportal.common.util.SnowflakeId")
    @Column(name = "ID")
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "TITLE")
    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Basic
    @Column(name = "URL")
    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Basic
    @Column(name = "LINK_ID")
    public String getLinkId() {
        return linkId;
    }

    public void setLinkId(String linkId) {
        this.linkId = linkId;
    }

    @Basic
    @Column(name = "STATUS")
    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
    @Basic
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "CREATE_PERSON")
    public String getCreatePerson() {
        return createPerson;
    }

    public void setCreatePerson(String createPerson) {
        this.createPerson = createPerson;
    }
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
    @Basic
    @Column(name = "UPDATE_TIME")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "UPDATE_PERSON")
    public String getUpdatePerson() {
        return updatePerson;
    }

    public void setUpdatePerson(String updatePerson) {
        this.updatePerson = updatePerson;
    }

    @Basic
    @Column(name = "DEL_FLAG")
    public String getDelFlag() {
        return delFlag;
    }

    public void setDelFlag(String delFlag) {
        this.delFlag = delFlag;
    }

    @Basic
    @Column(name = "STATION")
    public String getStation() {
        return station;
    }

    public void setStation(String station) {
        this.station = station;
    }

    @Basic
    @Column(name = "COMPLAIN_USER")
    public String getComplainUser() {
        return complainUser;
    }

    public void setComplainUser(String complainUser) {
        this.complainUser = complainUser;
    }

    @Basic
    @Column(name = "COMPLAIN_TOPIC")
    public String getComplainTopic() {
        return complainTopic;
    }

    public void setComplainTopic(String complainTopic) {
        this.complainTopic = complainTopic;
    }

    @Basic
    @Column(name = "COMPLAIN_CONTENT")
    public String getComplainContent() {
        return complainContent;
    }

    public void setComplainContent(String complainContent) {
        this.complainContent = complainContent;
    }
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
    @Basic
    @Column(name = "COMPLAIN_TIME")
    public Date getComplainTime() {
        return complainTime;
    }

    public void setComplainTime(Date complainTime) {
        this.complainTime = complainTime;
    }

    @Basic
    @Column(name = "COMPLAIN_STATUS")
    public String getComplainStatus() {
        return complainStatus;
    }

    public void setComplainStatus(String complainStatus) {
        this.complainStatus = complainStatus;
    }
    @JsonFormat(shape= JsonFormat.Shape.STRING,pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
    @Basic
    @Column(name = "DEAL_TIME")
    public Date getDealTime() {
        return dealTime;
    }

    public void setDealTime(Date dealTime) {
        this.dealTime = dealTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PortalMsgEntity that = (PortalMsgEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(title, that.title) &&
                Objects.equals(url, that.url) &&
                Objects.equals(linkId, that.linkId) &&
                Objects.equals(status, that.status) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createPerson, that.createPerson) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(updatePerson, that.updatePerson) &&
                Objects.equals(delFlag, that.delFlag) &&
                Objects.equals(station, that.station) &&
                Objects.equals(complainUser, that.complainUser) &&
                Objects.equals(complainTopic, that.complainTopic) &&
                Objects.equals(complainContent, that.complainContent) &&
                Objects.equals(complainTime, that.complainTime) &&
                Objects.equals(complainStatus, that.complainStatus) &&
                Objects.equals(dealTime, that.dealTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, title, url, linkId, status, createTime, createPerson, updateTime, updatePerson, delFlag, station, complainUser, complainTopic, complainContent, complainTime, complainStatus, dealTime);
    }
}
